<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 逻辑或 || 
        // 可以为变量设置一个默认值 
        function add(a, b){
            // console.log(a + b) 
            // 10 + undefined 
            a = a || 0 
            b = b || 0
            console.log(a + b)
        }

        // function add(a = 0, b = 0) {
        //     console.log(a + b )
        // }
        add(10)
    </script>
</body>
</html>